package com.qiannianai.app.wxapi;


import com.tencent.mm.opensdk.constants.ConstantsAPI;
import com.tencent.mm.opensdk.modelbase.BaseReq;
import com.tencent.mm.opensdk.modelbase.BaseResp;
import com.tencent.mm.opensdk.modelbiz.WXLaunchMiniProgram;
import com.umeng.socialize.weixin.view.WXCallbackActivity;

import cn.droidlover.xdroidmvp.log.XLog;

public class WXEntryActivity extends WXCallbackActivity {

    private static final String TAG = "WXEntryActivity";

    @Override
    public void onReq(BaseReq req) {
        super.onReq(req);
        XLog.d(TAG, "onReq:|| resp.errCode:" + req.getType());
        finish();
    }

    @Override
    public void onResp(BaseResp resp) {
        super.onResp(resp);
        XLog.d(TAG, "onResp:||resp.errCode:" + resp.errCode);
        if (resp.getType() == ConstantsAPI.COMMAND_LAUNCH_WX_MINIPROGRAM) {
            WXLaunchMiniProgram.Resp launchMiniProResp = (WXLaunchMiniProgram.Resp) resp;
            String extraData =launchMiniProResp.extMsg; //对应小程序组件 <button open-type="launchApp"> 中的 app-parameter 属性
        }
        finish();
    }
}
